package com.itheima.activities.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * @author :wujunjie
 * createTime :2022-12-20 19:45
 * description :
 */
//@Component
public class Myfanout {

    // 声明队列
    @RabbitListener(queues = "fanout.queue1")
    public void listenFanoutQueue1(String msg) {
        System.out.println("消费者1接收到Fanout消息：【" + msg + "】");
    }

    // 声明队列
    @RabbitListener(queues = "fanout.queue2")
    public void listenFanoutQueue2(String msg) {
        System.out.println("消费者2接收到Fanout消息：【" + msg + "】");
    }
}
